package org.example.item.model.entity;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.example.misc.enums.item.SaleSource;
import org.example.misc.model.CommonEntity;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

/**
 * 前台类目
 */
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "fore_ground_category")
@org.hibernate.annotations.Table(appliesTo = "fore_ground_category", comment = "后台类目")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ForeGroundCategory {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(nullable = false)
    private Long id;

    @Column
    private String name;
    @Column
    private Integer level;
    @Column
    private Long parentId;
    @Column
    private Long storeId;
    @Column
    @Enumerated(EnumType.STRING)
    private SaleSource source;

    @Embedded
    private CommonEntity commonEntity;
}
